package a2025_03_15;

public class longest_consecutive_sequence {
    public static void main(String[] args) {
        int[] nums=new int[]{0,0,1,2,3,4,5,6,7,8};
        int right=0;
        int maxLength=1;
        int temp=1;
        for(right=1;right<nums.length;right++){
            if(nums[right]-1==nums[right-1]) temp++;
            else if(nums[right]==nums[right-1]) ;
            else{
                maxLength=Math.max(maxLength,temp);
                temp=1;
            }
        }
        maxLength=Math.max(maxLength,temp);
    }
}
